#!/bin/bash

install_zsh() {
	if type dnf &>/dev/null; then
		sudo dnf install zsh util-linux-user -y
	fi

	if type apt &>/dev/null; then
		sudo apt install zsh -y
	fi
	if type zypper &>/dev/null; then
		sudo zypper install -y zsh
	fi
}

if [[ "$(basename $SHELL)" != "zsh" ]]; then
	install_zsh
	chsh -s /bin/zsh
	touch ~/.zshrc
	exit
else
	echo "shell is zsh"
fi
